package edu.bbu.commonproject.desktop.gui.view.swing.setup;

import java.awt.BorderLayout;

import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;

import edu.bbu.commonproject.desktop.gui.view.swing.utils.Design;

/**
 * The header setup panel.
 */
public class HeaderSetupPanel extends JPanel 
{
	/** The file menu. */
	private JMenu fileMenu;
	
	/** The help menu. */
	private JMenu helpMenu;
	
	/** The menu bar. */
	private JMenuBar jMenuBar;
	
	/** The logout menu item. */
	private JMenuItem logoutMenuItem;
	
	/** The exit emnu item. */
	private JMenuItem exitMenuItem;
	
	/** The help menu item. */
	private JMenuItem helpMenuItem;
	/** The about menu item.  */
	private JMenuItem aboutMenuItem;
	
	/** The logo setup panel. */
	private LogoSetupPanel logoSetupPanel;
	
	/**
	 * The constructor.
	 */
	public HeaderSetupPanel() 
	{
		this.setLayout(new BorderLayout());
		setComponents();
	}
	
	/**
	 * It sets up the components.
	 */
	private void setComponents() 
	{
		jMenuBar = new JMenuBar();
		
		fileMenu = new JMenu("Application");
		helpMenu = new JMenu("Help");
		
		Design.setMenuSelectedLook(fileMenu);
		Design.setMenuSelectedLook(helpMenu);
		
		
		logoutMenuItem = new JMenuItem("  Logout", new ImageIcon(Design.MENU_LOGOUT));
		exitMenuItem = new JMenuItem("  Exit", new ImageIcon(Design.MENU_CLOSE));
		
		helpMenuItem = new JMenuItem("  Help", new ImageIcon(Design.MENU_HELP));
		aboutMenuItem = new JMenuItem("  About", new ImageIcon(Design.MENU_ABOUT));
		
		Design.setMenuItemSelectedLook(exitMenuItem);
		Design.setMenuItemSelectedLook(logoutMenuItem);
		Design.setMenuItemSelectedLook(helpMenuItem);
		Design.setMenuItemSelectedLook(aboutMenuItem);
		
		fileMenu.add(logoutMenuItem);
		fileMenu.add(exitMenuItem);
		
		helpMenu.add(helpMenuItem);
		helpMenu.add(aboutMenuItem);
		
		jMenuBar.add(fileMenu);
		jMenuBar.add(helpMenu);

		logoSetupPanel = new LogoSetupPanel();

		this.add(jMenuBar, BorderLayout.NORTH);
		this.add(logoSetupPanel, BorderLayout.CENTER);
	}
	
	/**
	 * Gets the logo setup panel.
	 * @return the logo setup panel.
	 */
	public LogoSetupPanel getLogoSetupPanel()
	{
		return logoSetupPanel;
	}
	
	/**
	 * Gets the logout menu item.
	 * @return the logout menu item.
	 */
	public JMenuItem getLogoutMenuItem()
	{
		return logoutMenuItem;
	}
	
	/**
	 * Gets the exit menu item.
	 * @return the exit menu item.
	 */
	public JMenuItem getExitMenuItem()
	{
		return exitMenuItem;
	}
	
	/**
	 * Gets the help menu item.
	 * @return the help menu item.
	 */
	public JMenuItem getHelpMenuItem()
	{
		return helpMenuItem;
	}
	
	/**
	 * Gets the about menu item.
	 * @return the about menu item.
	 */
	public JMenuItem getAboutMenuItem()
	{
		return aboutMenuItem;
	}
}
